Trees in PoV and self-generating include files

I don't like www, sorry. Don't flame me for this ugly homepage design... But there are some of these enerving "friends" who forced me to set up this page. I hope, you will find it usefull.

Some time ago I made an include-file for povray that produces trees. The idea was born in a discusion whether it is possible to do recursion in pov or not. It's not possible, not directly... I found a trick to let povray produce its own include files and to produce nested while statements in this self-generated include files, which is equal to recursion.

You may have a look at these three trees. They are made with my include file (if you use xv, you should increase the gamma value, the pics are rendered with for very bright displays...)

437481 bytes 368896 bytes 436673 bytes

The tree sources:

Here's the include file which makes those trees: selftree.inc.

Ah, sorry. This is a newer version of the include file (see below), if you want to render these trees by yourself (they take VERY LONG time!), take this older version: selftree.old.inc

Sorry, documentation is in german only. If you want to know, how to use it, you can read this documentation (sorry, it's written in german, too...): Postscript-Version LaTeX-File

The docs are not ready yet...

A note: In the docs most of the parameters are simple numbers. I think, that is not flexible enough. So I changed the include file. Now you can use komplex functions for nearly all parameters. If you look at the include file, all values that are enclosed in parentheses should work with functions, all other should be simple numbers or names. Try some values and functions to see, which are good.

How does it work?

Simple...
PoVRay has these fance streams which you can use for printing some informations to stdout, stderr... With the option -GDFILENAME you can send this output to a file. Now: take a the debug stream (#debug "string") and produce some output that you can use as inputfile for pov. Do this from a source file, and then include this sourcefile into your first source file and you got it... Let's say, we want to include a nested while-statement. We can write it by ourself, or do this:
#declare depth = 3
#declare second = depth

#while (depth>0)

   #debug "#while bla bla bla\n"
   #debug "some code\n"
   #declare depth = depth-1

#end

#while (second>0)

   #debug "#end\n"
   #declare second = second-1

#end

This produces the following output to the debug-stream:
#while bla bla bla
some code
#while bla bla bla
some code
#while bla bla bla
some code
#end
#end
#end
Combining this with all the nice string functions in pov or with other streams, you can produce really fancy output-files, which can be used for including in the same file, which produced them. So you can take the code above in your scene file, and then, one line after this in the same file you say #include "bla.inc". Then running pov with +IYOURFILE.pov -GDbla.inc produces bla.inc from your debug statements and includes it while parsing and producing it... Very powerfull...

How do I use it??

Simple...
In your Scene file: Running povray:
povray +I YOURFILE.pov -GDmytrees.inc
mytrees.inc is the file, where the debug stream goes, and which you can include in your scene file (step 3 above)

Here are all the variables and their defaultvalues, you can set:

I think, that's it. It's not ready all, but I'm working on it (having no time... really). If you use it and publish your pics with it, please remark who made this include file (and, if you like, let me have a look at your Pictures). If you have any questions, mail me

There some more tools I made for and with pov. I hope, they will appear here anytime (too lazy...).

Have fun,
Stephan Kuhagen